
#include "nane/CodecSystem/Sound/SoundCodecSystemImpl_.h"
#include "nane/CodecSystem/Sound/SoundDecoderImpl_.h"

#include "nane/core/assert.h"

namespace nane
{
    ////////////////////////////////////////////////////////////////////////////////////////////////
    SoundCodecSystem::Implementation::Implementation()
        : SubSystem<ISoundCodecSystem>::Implementation("ISoundCodecSystem")
    {
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
    SoundCodecSystem::Implementation::~Implementation()
    {
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
    void SoundCodecSystem::Implementation::Release( SoundDecoder::Implementation* _soundDecoderImpl )
    {
        NANE_ASSERT_R( interface != NULL, "SoundCodecSystem must be initialized" );
        NANE_ASSERT_R( this == _soundDecoderImpl->creator, "SoundDecoder must be valid" );
        ISoundDecoder* soundDecoderInterface = _soundDecoderImpl->interface;
        delete _soundDecoderImpl;
        interface->ReleaseDecoder(soundDecoderInterface);
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
}   // namespace nane
